This is an introduction to InstaDMG, which is a powerful command line tool used to produce clean never booted OS X images, these images can include OSX incremental upgrades as well as 3rd party software and scripts.
This particular guide is a reference to getting started and just produce an up to date OSX 10.7 image with incremental upgrades applied, a later guide will introduce some more complex topics including adding 3rd party software and computer specific settings.
The first task is to download the InstaDMG code which is stored on Google you can view those files here http://instadmg.googlecode.com/svn/trunk/. The actual installation is done via Terminal.
Installing InstaDMG
This all works through the command line interface as there is no GUI layer for InstaDMG yet, so launch Terminal from Applications > Utilities > Terminal and change into your home directory and download the InstaDMG code using the ‘svn checkout’ command.
svn is Subversion and is an Open Source version control system for managing evolving code and its built into OSX. The command below put you in your home directory and will download the code and create a folder in your home directory called ‘InstaDMG’, you can name this folder anything you like and note that it is presented as an option after the main command if you do not add the option the files will be located in a directory called ‘trunk’ (which can be renamed).
cd ; svn checkout http://instadmg.googlecode.com/svn/trunk InstaDMG
Running the command will download and install the required files, the last of the file downloads will have output from the Terminal similar to below :
A trunk/Documentation/InstallerChoices/README A trunk/Documentation/InstallerChoices/10.6_InstallerChoices.xml A trunk/Documentation/README U trunk Checked out revision 426.
InstaDMG is constantly updated to deal with the OS X updates from Apple. To download the latest version of InstaDMG all that is needed is to move into the installation directory where InstaDMG lives and run a ‘svn’ update, so for example if the install directory is “InstaDMG” and in your home directory you would run:
[~]: cd ~/InstaDMG/ [~/InstaDMG]: svn update At revision 453.
Here there is no updated files and the revision is stated at 453, any updated files downloaded would be named and a higher revision number will be declared. Curent revision is at 453 and includes incremental updates to OS X 10.7.4.
Preparing the Base OS X 10.7 Image
After the InstaDMG is downloaded the next step is to make a base installation image of OS X 10.7, this has been done in the past through the generic installer disks of OSX, but since OSX 10.7 Lion is diskless it poses a slight problem.
The solution is to extract the InstallESD.dmg from the Lion.app after it is downloaded from the App Store and before it is installed, as when it is installed the app is then deleted – this shows how to reveal the InstallESD.dmg and also a guide to burn a generic copy of 10.7 to disc.
If you have the InstallESD.dmg from Lion just put/copy it in the path below and move onto the next section:
InstaDMG/InstallerFiles/InstallerDiscs/InstallESD.dmg
If for some reason you have a disk and want to import it the traditional way in InstaDMG, pop in the disk let it mount in the finder then in the Terminal cd into your InstaDMG and run the import command as below with “sudo”, it needs to be imported as burning images straight from hard disk is a lot faster than from optical disk.
[~]: cd ~/InstaDMG/AddOns/InstaUp2Date/ [~]: sudo ./importDisk.py --automatic
This will take a bit of time, also make sure no other disks or external drives are mounted as this may produce an error – what you should end up when finished is a “MacOS X Client 10.7 11A511.dmg” filed in this path:
InstaDMG/InstallerFiles/InstallerDiscs/MacOS X Client 10.7 11A511.dmg
Getting The Image Up to Date
Next up and final in one command is to download the OS X incremental updates and produce a fresh generic up-to-date, fully patched, vanilla OS X 10.7 Image. This done through the catalog file which is stored in
InstaDMG/AddOns/InstaUp2Date/CatalogFiles/10.7_vanilla.catalog
and the command to run is back in the InstaUp2Date folder, change directory to there, then run the command as below:
[~]: cd ~/InstaDMG/AddOns/InstaUp2Date/ [~]: sudo ./instaUp2Date.py -p 10.7_vanilla
The actual catalog file you run depends on what type of hardware you have – there are a couple of flavours – you need to run the one the most appropriately suits your hardware, in this instance a generic 10.7 build is being used. The .catalog extension does not need to be added in running the command.
The OS X incremental updates are downloaded and stored on your local drive, future builds will only pull down new updates. After the updates are downloaded they are applied to the original mounted MacOS X Client 10.7 11A511.dmg image and in turn an up to date image is spat out in the directory – “~/InstaDMG/OutputFiles” named “10.7 Vanilla.dmg” which is the all-encompassing new master image.
The initial output in the terminal when the above command is run looks like this:
[~/InstaDMG/AddOns/InstaUp2Date]: sudo ./instaUp2Date.py -p 10.7_vanilla Password: Parsing the catalog files for 10.7_vanilla OS X Lion Update 10.7.1 Java For Mac OS X 10.7 Remote Desktop Client 3.5.1 iTunes 10.4 Finding and validating the sources for 10.7_vanilla OS X Lion Update 10.7.1 - found based on checksum and verified in 2 seconds Java For Mac OS X 10.7 - found based on checksum and verified in 2 seconds Remote Desktop Client 3.5.1 - found based on checksum and verified in less than one second iTunes 10.4 - found based on checksum and verified in 8 seconds
The final output at the tail of the command will be like this:
19:55:14 ###### Correcting some generic installer errors ###### Correcting symlinks that point off the disk Closing programs that have opened files on the disk Deleting Extensions.mkext cache file Deleting cache files created during installations 21:38:18 ###### Creating the deployment DMG and scanning for ASR ###### Rename the deployment volume: Macintosh HD Create a read-only image Scanning image for ASR: /instadmg/OutputFiles/10.7 Vanilla.dmg ASR image scan complete 21:50:17 ###### InstaDMG Complete ###### 21:50:17 ###### Cleaning up ###### Ejecting images Deleting scratch DMG Done
And there you have it one OSX 10.7 image ready for deployment, which can be used in any deployment method including ASR, DeployStudio or as a NetBoot image.
To add a new user pre-image build and clear the Apple Registration screens on boot up – part 2 may be of interest.
To customise prefs and computer settings – check out part 3.